package cn.itlaobing.web.servlet;

import cn.itlaobing.service.GoodsService;
import cn.itlaobing.web.annotation.RequestMapping;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by Administrator on 2017/11/20 0020.
 */
@WebServlet("/goods/*")
public class GoodsServlet extends BaseServlet{

    @RequestMapping("/index")
    public void index(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        GoodsService goodsService=new GoodsService();
        request.setAttribute("goodsList",goodsService.findAll());
        toView(request,response,"/goods/index");
    }
}
